We study properties of irreducible and completely reducible representations of finitely generated groups Gamma into reductive algebraic groups G in in the context of the geometric invariant theory of the G-action on Hom(Gamma,G) by conjugation. In particular, we study properties of character varieties, X_G(Gamma)=Hom(Gamma,G)//G. We describe the tangent spaces to X_G(Gamma) in terms of first cohomology groups of Gamma with twisted coefficients, generalizing the well known formula. Let M be an orientable 3-manifold with a connected boundary F of genus > 1 and let X_G^g(F) be the subset of the G -character variety of F composed of conjugacy classes of good representations. By a theorem of Goldman, X_G^g(F) is a holomorphic symplectic manifold. We prove that the set of good G-representations of pi_1(F) which extend to representations of pi_1(M) is an isotropic submanifold of X_G^g(F). If these representations correspond to reduced points of the G-character variety of M then this submanifold is Lagrangian.